public void SetAsrsResManage(AsrsInterface.IAsrsManageToCtl asrsRes) { asrsPresenter.SetAsrsResManage(asrsRes); this.asrsResManage = asrsRes; PrcsCtlModelsLishen.NodeSwitchInput nodeSwitch = ctlNodeManager.GetNodeByID("4001") as PrcsCtlModelsLishen.NodeSwitchInput; nodeSwitch.AsrsResManage = asrsResManage; nodeSwitch.AsrsCtl = asrsPresenter.AsrsCtls[0]; nodeSwitch.AsrsPort = ctlNodeManager.GetNodeByID("2009") as AsrsControl.AsrsPortalModel; }
public override bool ExeBusiness(ref string reStr) { if (!devStatusRestore) { devStatusRestore = DevStatusRestore(); } if (db2Vals[0] == 1) { currentTaskPhase = 0; Array.Clear(this.db1ValsToSnd, 0, this.db1ValsToSnd.Count()); rfidUID = string.Empty; currentTaskDescribe = "等待新的任务"; //return true; } //if(db1ValsToSnd[0] >1) //分流完成后 //{ // return true; //} if (db2Vals[0] == 2) { if (currentTaskPhase == 0) { currentTaskPhase = 1; } } switch (this.currentTaskPhase) { case 1: { currentTaskDescribe = "开始读RFID"; this.rfidUID = ""; if (SysCfg.SysCfgModel.UnbindMode) { this.rfidUID = System.Guid.NewGuid().ToString(); } else { if (SysCfg.SysCfgModel.SimMode || SysCfg.SysCfgModel.RfidSimMode) { this.rfidUID = this.SimRfidUID; } else { this.rfidUID = this.barcodeRW.ReadBarcode(); } } if (string.IsNullOrWhiteSpace(this.rfidUID)) { if (this.db1ValsToSnd[0] != barcodeFailedStat) { logRecorder.AddDebugLog(nodeName, "读料框条码失败"); } this.db1ValsToSnd[0] = barcodeFailedStat; break; } this.rfidUID = this.rfidUID.Trim(new char[] { '\0', '\r', '\n', '\t', ' ' }); string palletPattern = @"^[a-z|A-Z|0-9]{4}TP[0-9]{4,}"; if (!Regex.IsMatch(this.rfidUID, palletPattern)) { if (this.db1ValsToSnd[0] != barcodeFailedStat) { logRecorder.AddDebugLog(nodeName, "读料框条码不符合规则," + this.rfidUID); this.currentTaskDescribe = "读料框条码不符合规则," + this.rfidUID; } this.db1ValsToSnd[0] = barcodeFailedStat; break; } /* * //检测是否跟库里有重码 * string[] houseNames = new string[] { AsrsModel.EnumStoreHouse.A1库房.ToString(), AsrsModel.EnumStoreHouse.A2库房.ToString(), * AsrsModel.EnumStoreHouse.B1库房.ToString(), AsrsModel.EnumStoreHouse.C1库房.ToString(),AsrsModel.EnumStoreHouse.C2库房.ToString(),AsrsModel.EnumStoreHouse.C3库房.ToString() }; * foreach (string houseName in houseNames) * { * string cellIn = AsrsResManage.IsProductCodeInStore(houseName, this.rfidUID, ref reStr); * if (!string.IsNullOrWhiteSpace(cellIn)) * { * if (this.db1ValsToSnd[0] != 3) * { * currentTaskDescribe = string.Format("条码异常,条码{0}已经在库房{1},库位{2}", this.rfidUID.Length.ToString(), houseName, cellIn); * logRecorder.AddDebugLog(nodeName, currentTaskDescribe); * } * this.db1ValsToSnd[0] = 3; * return true; * } * }*/ logRecorder.AddDebugLog(this.nodeName, "读到托盘号:" + this.rfidUID); this.currentTaskPhase++; break; } case 2: { //分流 currentTaskDescribe = "等待分流"; int switchRe = 0; int step = 0; if (!MesAcc.GetStep(this.rfidUID, out step, ref reStr)) { currentTaskDescribe = "查询MES工步失败:" + reStr; break; } if (this.nodeID == "4001") { if (step == 0) { currentTaskDescribe = string.Format("{0} 入库分流失败,步号为0,禁止入库", this.rfidUID); if (this.db1ValsToSnd[0] != 4) { logRecorder.AddDebugLog(nodeName, string.Format("{0} 入库分流失败,步号为0,禁止入库", this.rfidUID)); } this.db1ValsToSnd[0] = 4; // break; } } if (this.nodeID == "4004") { step = 5; if (!MesAcc.UpdateStep(step, this.rfidUID, ref reStr)) { currentTaskDescribe = "更新MES工步失败:" + reStr; break; } } if (this.nodeID == "4005") { step = 6; if (!MesAcc.UpdateStep(step, this.rfidUID, ref reStr)) { currentTaskDescribe = "更新MES工步失败:" + reStr; break; } } if (this.nodeID == "4006") { if (step > 0) { if (step >= 11) { step = 0; if (!MesAcc.UpdateStep(step, this.rfidUID, ref reStr)) { currentTaskDescribe = "更新MES工步失败:" + reStr; break; } } else if (step != 10) { step = 10; if (!MesAcc.UpdateStep(step, this.rfidUID, ref reStr)) { currentTaskDescribe = "更新MES工步失败:" + reStr; break; } } } } FlowPathModel switchPath = FindFirstValidPath(this.rfidUID, ref reStr); if (switchPath == null) { switchRe = 0; //无可用路径,等待 this.db1ValsToSnd[0] = (short)switchRe; this.currentTaskDescribe = reStr; break; } else { CtlNodeBaseModel node = switchPath.NodeList[0]; if (this.nodeID == "4004") { AsrsControl.AsrsPortalModel port = (node as AsrsControl.AsrsPortalModel); if (port == null) { break; } AsrsModel.CellCoordModel requireCell = null; AsrsControl.AsrsCtlModel asrsCtl = port.AsrsCtl; AsrsInterface.IAsrsManageToCtl asrsResManage = port.AsrsCtl.AsrsResManage; string logicArea = "通用分区"; if (dlgtGetLogicArea != null) { logicArea = dlgtGetLogicArea(this.rfidUID, asrsCtl, step); } if (string.IsNullOrWhiteSpace(logicArea)) { this.currentTaskDescribe = string.Format("{0} 检索货区失败,未配置", this.rfidUID); break; } // AsrsModel.EnumLogicArea logicArea = (AsrsModel.EnumLogicArea)Enum.Parse(typeof(AsrsModel.EnumLogicArea), SysCfg.SysCfgModel.asrsStepCfg.AsrsAreaSwitch(step)); if (!asrsResManage.CellRequire(asrsCtl.HouseName, logicArea, ref requireCell, ref reStr)) { Console.WriteLine("{0}申请库位失败,{1}", nodeName, reStr); break; } if (requireCell.Row == 1) { switchRe = 2; asrsCtl.SetAsrsCheckinRow(requireCell.Row); } else if (requireCell.Row == 2) { switchRe = 3; asrsCtl.SetAsrsCheckinRow(requireCell.Row); } else { break; } logRecorder.AddDebugLog(nodeName, string.Format("{0}锁定分容库位第{1}排", this.rfidUID, requireCell.Row)); } else { switchRe = switchPath.PathSeq + 1; } this.db1ValsToSnd[0] = (short)switchRe; /* * if(this.nodeID=="4006") //OCV后入库分流时,把条码后4位以整形发给PLC * { * this.db1ValsToSnd[1] = short.Parse(this.rfidUID.Substring(this.rfidUID.Length - 4, 4)); * }*/ if (node.GetType().ToString() == "AsrsControl.AsrsPortalModel") { (node as AsrsControl.AsrsPortalModel).PushPalletID(this.rfidUID); } string logStr = string.Format("{0}分流,进入{1}", this.rfidUID, switchPath.NodeList[0].NodeName); logRecorder.AddDebugLog(nodeName, logStr); AddProduceRecord(this.rfidUID, logStr); if (this.nodeID == "4001") { if (step >= 4) { step = 0; if (!MesAcc.UpdateStep(step, this.rfidUID, ref reStr)) { currentTaskDescribe = "更新MES工步失败:" + reStr; break; } } } } this.currentTaskPhase++; break; } case 3: { currentTaskDescribe = "分流完成"; break; } default: break; } return(true); }
private bool LoadModules() { string reStr = ""; //扩展view asrsCheckoutModifyView = new ExtentViews.AsrsCheckoutModifyView("非正常出库调整"); logView = new LogView("日志"); childViews.Add(logView); logView.SetParent(this); logView.RegisterMenus(this.menuStrip1, "日志查询"); logView.SetLogDispInterface(this); presenter.logRecorder = logView.GetLogrecorder(); configView = new ConfiManageView(); childViews.Add(configView); configView.SetParent(this); configView.RegisterMenus(this.menuStrip1, "配置管理"); configView.SetLoginterface(logView.GetLogrecorder()); palletTraceView = new ProduceTraceView("托盘追溯"); childViews.Add(palletTraceView); palletTraceView.SetParent(this); palletTraceView.RegisterMenus(this.menuStrip1, "托盘追溯"); palletTraceView.SetLoginterface(logView.GetLogrecorder()); asrsCtlView = new AsrsCtlView("立库控制"); childViews.Add(asrsCtlView); if (!asrsCtlView.RegistExtView(asrsCheckoutModifyView, ref reStr)) { Console.WriteLine(reStr); return(false); } asrsCtlView.SetParent(this); asrsCtlView.RegisterMenus(this.menuStrip1, "立库控制"); asrsCtlView.SetLoginterface(logView.GetLogrecorder()); asrsCtlView.SetAsrsPresenter(presenter.AsrsPresenter); asrsCtlView.Init(); nodeMonitorView = new CtlNodeMonitorView("流程监控"); childViews.Add(nodeMonitorView); nodeMonitorView.SetParent(this); nodeMonitorView.RegisterMenus(this.menuStrip1, "流程监控"); nodeMonitorView.SetLoginterface(logView.GetLogrecorder()); storageView = new StorageMainView(); childViews.Add(storageView); storageView.SetParent(this); storageView.RegisterMenus(this.menuStrip1, "库存管理"); storageView.SetLoginterface(logView.GetLogrecorder()); nodeMonitorView.SetAsrsBatchSetCtl(storageView.BatchSetControl); nodeMonitorView.SetAsrsMonitors(asrsCtlView.AsrsMonitors); AsrsInterface.IAsrsManageToCtl asrsResManage = null; AsrsInterface.IAsrsCtlToManage asrsCtl = presenter.GetAsrsCtlInterfaceObj(); if (!storageView.Init(asrsCtl, ref asrsResManage, ref reStr)) { // logView.GetLogrecorder().AddLog(new LogModel("主模块", "立库管理层模块初始化错误," + reStr, EnumLoglevel.错误)); Console.WriteLine("立库管理层模块初始化错误," + reStr); return(false); } asrsCtlView.SetAsrsResManage(asrsResManage); asrsCheckoutModifyView.SetAsrsResManage(asrsResManage); asrsCheckoutModifyView.AsrsPresenter = presenter.AsrsPresenter; AttachModuleView(nodeMonitorView); foreach (BaseChildView childView in childViews) { childView.ChangeRoleID(this.roleID); } presenter.SetAsrsResManage(asrsResManage); string[] nodeEnableCfgIDS = new string[] { "1001", "1002", "1003", "1004", "1005", "1006" }; List <FlowCtlBaseModel.CtlNodeBaseModel> nodeEnableCfgs = new List <FlowCtlBaseModel.CtlNodeBaseModel>(); foreach (string nodeID in nodeEnableCfgIDS) { nodeEnableCfgs.Add(presenter.CtlNodeManager.GetNodeByID(nodeID)); } configView.SetCfgNodes(nodeEnableCfgs); return(true); }
private bool LoadModules() { logView = new LogView("日志"); childViews.Add(logView); logView.SetParent(this); logView.RegisterMenus(this.menuStrip1, "日志查询"); logView.SetLogDispInterface(this); presenter.logRecorder = logView.GetLogrecorder(); configView = new ConfiManageView(); childViews.Add(configView); configView.SetParent(this); configView.RegisterMenus(this.menuStrip1, "配置管理"); configView.SetLoginterface(logView.GetLogrecorder()); palletTraceView = new ProduceTraceView("托盘追溯"); childViews.Add(palletTraceView); palletTraceView.SetParent(this); palletTraceView.RegisterMenus(this.menuStrip1, "托盘追溯"); palletTraceView.SetLoginterface(logView.GetLogrecorder()); asrsCtlView = new AsrsCtlView("立库控制"); childViews.Add(asrsCtlView); asrsCtlView.SetParent(this); asrsCtlView.RegisterMenus(this.menuStrip1, "立库控制"); asrsCtlView.SetLoginterface(logView.GetLogrecorder()); asrsCtlView.SetAsrsPresenter(presenter.AsrsPresenter); asrsCtlView.Init(); nodeMonitorView = new CtlNodeMonitorView("流程监控"); childViews.Add(nodeMonitorView); nodeMonitorView.SetParent(this); nodeMonitorView.RegisterMenus(this.menuStrip1, "流程监控"); nodeMonitorView.SetLoginterface(logView.GetLogrecorder()); nodeMonitorView.SetAsrsMonitors(asrsCtlView.AsrsMonitors); this.nodeMonitorView.WmsSimViewDisp = true; AsrsInterface.IAsrsManageToCtl asrsResManage = presenter.WmsSvc; AsrsInterface.IAsrsCtlToManage asrsCtl = presenter.GetAsrsCtlInterfaceObj(); asrsCtlView.SetAsrsResManage(asrsResManage); AttachModuleView(nodeMonitorView); foreach (BaseChildView childView in childViews) { childView.ChangeRoleID(this.roleID); } presenter.SetAsrsResManage(asrsResManage); string[] nodeEnableCfgIDS = new string[] { "1001", "1002", "1003", "1004", "1005", "1006" }; List <FlowCtlBaseModel.CtlNodeBaseModel> nodeEnableCfgs = new List <FlowCtlBaseModel.CtlNodeBaseModel>(); foreach (string nodeID in nodeEnableCfgIDS) { nodeEnableCfgs.Add(presenter.CtlNodeManager.GetNodeByID(nodeID)); } configView.SetCfgNodes(nodeEnableCfgs); return(true); }
private bool AsrsOutportBusiness(AsrsControl.AsrsPortalModel port, ref string reStr) { try { MesDBAccess.BLL.palletBll palletDBll = new MesDBAccess.BLL.palletBll(); if (port.PortCata == 1) { return(true); } if (port.BindedTaskOutput == SysCfg.EnumAsrsTaskType.空筐出库) { if (port.Db2Vals[0] == 1) { port.Db1ValsToSnd[0] = 1; } return(true); } else if (port.BindedTaskOutput == SysCfg.EnumAsrsTaskType.产品出库) { if (port.Db2Vals[1] == 1) { port.Db1ValsToSnd[0] = 1; } } else { return(true); } if (port.Db1ValsToSnd[0] == 2) { return(true); } if (port.Db2Vals[1] != 2) { return(true); } Int16 palletCata = port.Db2Vals[2]; if (palletCata < 1 || palletCata > 3) { return(true); } AsrsControl.AsrsCtlModel asrsCtl = port.AsrsCtl; string houseName = asrsCtl.HouseName; AsrsInterface.IAsrsManageToCtl asrsResManage = port.AsrsCtl.AsrsResManage; //遍历所有库位,判断材料类别,按照先入先出规则,匹配出库的货位。 Dictionary <string, AsrsModel.GSMemTempModel> asrsStatDic = new Dictionary <string, AsrsModel.GSMemTempModel>(); if (!asrsResManage.GetAllGsModel(ref asrsStatDic, ref reStr)) { Console.WriteLine(string.Format("{0} 获取货位状态失败", houseName)); return(false); } List <AsrsModel.GSMemTempModel> validCells = new List <AsrsModel.GSMemTempModel>(); string shopRequire = ""; if (port.NodeName == "A1库物料出口1") { shopRequire = "1号车间"; } else if (port.NodeName == "A1库物料出口2") { shopRequire = "2号车间"; } else if (port.NodeName == "A1库物料出口3") { shopRequire = "3号车间"; } //检查是否存在未执行完的任务 List <CtlDBAccess.Model.ControlTaskModel> unFinishedTasks = GetRunningTask((int)SysCfg.EnumAsrsTaskType.产品出库, shopRequire, palletCata, ref reStr); if (unFinishedTasks != null && unFinishedTasks.Count() > 0) { return(true); } int r = 1, c = 1, L = 1; for (r = 1; r < asrsCtl.AsrsRow + 1; r++) { for (c = 1; c < asrsCtl.AsrsCol + 1; c++) { for (L = 1; L < asrsCtl.AsrsLayer + 1; L++) { string strKey = string.Format("{0}:{1}-{2}-{3}", houseName, r, c, L); AsrsModel.GSMemTempModel cellStat = null; if (!asrsStatDic.Keys.Contains(strKey)) { continue; } cellStat = asrsStatDic[strKey]; if ((!cellStat.GSEnabled) || (cellStat.GSTaskStatus == AsrsModel.EnumGSTaskStatus.锁定.ToString()) || (cellStat.GSStatus != AsrsModel.EnumCellStatus.满位.ToString())) { // reStr = string.Format("货位{0}-{1}-{2}禁用,无法生成出库任务", cell.Row, cell.Col, cell.Layer); continue; } AsrsModel.CellCoordModel cell = new AsrsModel.CellCoordModel(r, c, L); List <string> storGoods = new List <string>(); if (!asrsResManage.GetStockDetail(houseName, cell, ref storGoods)) { continue; } if (storGoods.Count() < 1) { continue; } MesDBAccess.Model.palletModel pallet = palletDBll.GetModel(storGoods[0]); short productCata = 0; string strCataName = "";// "正极材料"; string shopName = ""; if (!PrcsCtlModelsLishen.NodeSwitchInput.ParsePalletID(storGoods[0], ref shopName, ref productCata, ref strCataName, ref reStr)) { continue; } //if (pallet.palletCata == palletCata.ToString()) if (productCata == palletCata && shopRequire == shopName) { validCells.Add(cellStat); } //if (storGoods[0].Substring(2, 1) == palletCata.ToString()) //{ // validCells.Add(cellStat); //} } } } if (validCells.Count() > 0) { //排序,按照先入先出 AsrsModel.GSMemTempModel firstGS = validCells[0]; if (validCells.Count() > 1) { for (int i = 1; i < validCells.Count(); i++) { AsrsModel.GSMemTempModel tempGS = validCells[i]; if (tempGS.InHouseDate < firstGS.InHouseDate) { firstGS = tempGS; } } } //生成出库任务 string[] strCellArray = firstGS.GSPos.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries); int row = int.Parse(strCellArray[0]); int col = int.Parse(strCellArray[1]); int layer = int.Parse(strCellArray[2]); AsrsModel.CellCoordModel cell = new AsrsModel.CellCoordModel(row, col, layer); if (asrsCtl.GenerateOutputTask(cell, port.BindedTaskOutput, true, port.PortSeq, ref reStr, new List <short> { palletCata }, port.AsrsTaskPri)) { port.Db1ValsToSnd[0] = 2; } else { Console.WriteLine("生成任务{0}失败,{1}", port.BindedTaskOutput.ToString(), reStr); } } return(true); } catch (Exception ex) { reStr = ex.ToString(); return(false); } }
/// <summary> /// 模块加载 /// </summary> private void ModuleAttach() { logView = new LogView("日志"); childViews.Add(logView); logView.SetParent(this); asrsCtlView = new AsrsCtlView("立库控制"); childViews.Add(asrsCtlView); asrsCtlView.SetParent(this); asrsCtlView.RegisterMenus(this.menuStrip1, "立库控制"); asrsCtlView.SetLoginterface(logView.GetLogrecorder()); asrsCtlView.Init(); nodeMonitorView = new ProcessMonitorView("流程监控"); childViews.Add(nodeMonitorView); nodeMonitorView.SetParent(this); nodeMonitorView.RegisterMenus(this.menuStrip1, "流程监控"); nodeMonitorView.SetLoginterface(logView.GetLogrecorder()); nodeMonitorView.SetAsrsPresener(asrsCtlView.GetPresenter()); if (!nodeMonitorView.Init()) { MessageBox.Show("控制模块初始化失败"); return; } nodeMonitorView.SetAsrsMonitors(asrsCtlView.AsrsMonitors); // nodeMonitorView.SetAsrsBatchSetCtl(asrsCtlView.AsrsBatchSettingCtl); logView.RegisterMenus(this.menuStrip1, "日志查询"); logView.SetLogDispInterface(this); recordView = new RecordView(); recordView.SetParent(this); recordView.RegisterMenus(this.menuStrip1, "记录查询与管理"); recordView.SetLoginterface(logView.GetLogrecorder()); //recordView.SetHKAccessObj(nodeMonitorView.Presenter.HkAccessList[1]); //recordView.SetOcvAccessObj(nodeMonitorView.Presenter.OcvAccessObj); storageView = new StorageMainView(); childViews.Add(storageView); storageView.SetParent(this); storageView.RegisterMenus(this.menuStrip1, "库存管理"); storageView.SetLoginterface(logView.GetLogrecorder()); nodeMonitorView.SetAsrsBatchSetCtl(storageView.BatchSetControl); AsrsInterface.IAsrsManageToCtl asrsResManage = null; AsrsInterface.IAsrsCtlToManage asrsCtl = asrsCtlView.GetPresenter(); string reStr = ""; if (!storageView.Init(asrsCtl, ref asrsResManage, ref reStr)) { logView.GetLogrecorder().AddLog(new LogModel("主模块", "立库管理层模块初始化错误," + reStr, EnumLoglevel.错误)); } asrsCtlView.SetAsrsResManage(asrsResManage); nodeMonitorView.SetAsrsResManage(asrsResManage); configView = new ConfiManageView(); childViews.Add(configView); configView.SetParent(this); configView.RegisterMenus(this.menuStrip1, "配置管理"); configView.SetLoginterface(logView.GetLogrecorder()); List <string> logSrcList = new List <string>(); //List<string> logSrcs = asrsCtlView.GetLogsrcList(); //if(logSrcs != null) //{ // logSrcList.AddRange(logSrcs); //} List <string> logSrcs = nodeMonitorView.GetLogsrcList(); if (logSrcs != null) { logSrcList.AddRange(logSrcs); } logSrcs = storageView.GetLogsrcList(); if (logSrcs != null) { logSrcList.AddRange(logSrcs); } logView.SetLogsrcList(logSrcList); AttachModuleView(nodeMonitorView); foreach (BaseChildView childView in childViews) { childView.ChangeRoleID(this.roleID); } }
public NodeSwitchInput() { AsrsResManage = null; }
private bool LoadModules() { logView = new LogView("日志"); childViews.Add(logView); logView.SetParent(this); logView.RegisterMenus(this.menuStrip1, "日志查询"); logView.SetLogDispInterface(this); nodeMonitorView = new CtlNodeMonitorView("流程监控"); childViews.Add(nodeMonitorView); nodeMonitorView.SetParent(this); nodeMonitorView.RegisterMenus(this.menuStrip1, "流程监控"); nodeMonitorView.SetLoginterface(logView.GetLogrecorder()); palletTraceView = new ProduceTraceView("托盘追溯"); childViews.Add(palletTraceView); palletTraceView.SetParent(this); palletTraceView.RegisterMenus(this.menuStrip1, "托盘追溯"); palletTraceView.SetLoginterface(logView.GetLogrecorder()); asrsMonitorView = new AsrsMonitorView("立库监控"); childViews.Add(asrsMonitorView); asrsMonitorView.SetParent(this); asrsMonitorView.RegisterMenus(this.menuStrip1, "立库控制"); asrsMonitorView.SetLoginterface(logView.GetLogrecorder()); storageView = new StorageMainView(); childViews.Add(storageView); storageView.SetParent(this); storageView.RegisterMenus(this.menuStrip1, "库存管理"); storageView.SetLoginterface(logView.GetLogrecorder()); nodeMonitorView.SetAsrsBatchSetCtl(storageView.BatchSetControl); AsrsInterface.IAsrsManageToCtl asrsResManage = null; string svcAddr = ConfigurationManager.AppSettings["AsrsCtlSvcAddr"]; AsrsInterface.IAsrsCtlToManage asrsCtl = ChannelFactory <AsrsInterface.IAsrsCtlToManage> .CreateChannel(new BasicHttpBinding(), new EndpointAddress(svcAddr)); if (asrsCtl == null) { Console.WriteLine("WCS服务未启动"); return(false); } // AsrsInterface.IAsrsCtlToManage asrsCtl = presenter.GetAsrsCtlInterfaceObj(); //通过主控wcs服务获取接口对象 string reStr = ""; if (!storageView.Init(asrsCtl, ref asrsResManage, ref reStr)) { // logView.GetLogrecorder().AddLog(new LogModel("主模块", "立库管理层模块初始化错误," + reStr, EnumLoglevel.错误)); Console.WriteLine("立库管理层模块初始化错误," + reStr); return(false); } nodeMonitorView.SetAsrsBatchSetCtl(storageView.BatchSetControl); foreach (BaseChildView childView in childViews) { childView.ChangeRoleID(this.roleID); } AttachModuleView(nodeMonitorView); return(true); }
private bool LoadModules() { logView = new LogView("日志"); childViews.Add(logView); logView.SetParent(this); logView.RegisterMenus(this.menuStrip1, "日志查询"); logView.SetLogDispInterface(this); configView = new ConfiManageView(); childViews.Add(configView); configView.SetParent(this); configView.RegisterMenus(this.menuStrip1, "配置管理"); configView.SetLoginterface(logView.GetLogrecorder()); asrsCtlView = new AsrsCtlView("立库控制"); childViews.Add(asrsCtlView); asrsCtlView.SetParent(this); asrsCtlView.RegisterMenus(this.menuStrip1, "立库控制"); asrsCtlView.SetLoginterface(logView.GetLogrecorder()); asrsCtlView.SetAsrsPresenter(presenter.AsrsPresenter); asrsCtlView.Init(); nodeMonitorView = new CtlNodeMonitorView("流程监控"); childViews.Add(nodeMonitorView); nodeMonitorView.SetParent(this); nodeMonitorView.RegisterMenus(this.menuStrip1, "流程监控"); nodeMonitorView.SetLoginterface(logView.GetLogrecorder()); storageView = new StorageMainView(); childViews.Add(storageView); storageView.SetParent(this); storageView.RegisterMenus(this.menuStrip1, "库存管理"); storageView.SetLoginterface(logView.GetLogrecorder()); nodeMonitorView.SetAsrsBatchSetCtl(storageView.BatchSetControl); nodeMonitorView.SetAsrsMonitors(asrsCtlView.AsrsMonitors); List <string> logSrcs = presenter.GetLogsrcList(); List <string> storLogSrcs = storageView.GetLogsrcList(); if (storLogSrcs != null) { logSrcs.AddRange(storLogSrcs); } logView.SetLogsrcList(logSrcs); AsrsInterface.IAsrsManageToCtl asrsResManage = null; AsrsInterface.IAsrsCtlToManage asrsCtl = presenter.GetAsrsCtlInterfaceObj(); string reStr = ""; if (!storageView.Init(asrsCtl, ref asrsResManage, ref reStr)) { // logView.GetLogrecorder().AddLog(new LogModel("主模块", "立库管理层模块初始化错误," + reStr, EnumLoglevel.错误)); Console.WriteLine("立库管理层模块初始化错误," + reStr); return(false); } asrsCtlView.SetAsrsResManage(asrsResManage); AttachModuleView(nodeMonitorView); foreach (BaseChildView childView in childViews) { childView.ChangeRoleID(this.roleID); } presenter.SetAsrsResManage(asrsResManage); return(true); }