//A1库出库任务委托 public CtlDBAccess.Model.ControlTaskModel GetCheckoutOfA1(AsrsControl.AsrsCtlModel asrsCtl, IAsrsManageToCtl asrsResManage, IList <CtlDBAccess.Model.ControlTaskModel> taskList, SysCfg.EnumAsrsTaskType taskType) { if (asrsCtl.HouseName != AsrsModel.EnumStoreHouse.A1库房.ToString()) { return(null); } if (taskList == null) { return(null); } NodeVirStation nodeStation = GetNodeByID("4001") as NodeVirStation; //AsrsModel.EnumLogicArea requireCheckoutArea = AsrsModel.EnumLogicArea.一次高温A区; List <AsrsModel.EnumLogicArea> areaList = new List <AsrsModel.EnumLogicArea>(); if (nodeStation.Db2Vals[2] == 1) { //requireCheckoutArea = AsrsModel.EnumLogicArea.一次高温A区; areaList.Add(AsrsModel.EnumLogicArea.一次高温A区); areaList.Add(AsrsModel.EnumLogicArea.一次高温B区); } else if (nodeStation.Db2Vals[2] == 2) { areaList.Add(AsrsModel.EnumLogicArea.一次高温B区); areaList.Add(AsrsModel.EnumLogicArea.一次高温A区); } else { return(null); } string houseName = asrsCtl.HouseName; ControlTaskModel task = null; foreach (AsrsModel.EnumLogicArea requireCheckoutArea in areaList) { task = GetCheckoutOfArea(asrsCtl, asrsResManage, taskType, taskList, requireCheckoutArea); if (task != null) { break; } } return(task); }
private bool ParseCtlnodes(XElement CtlnodeRoot, ref string reStr) { if (CtlnodeRoot == null) { reStr = "系统配置文件错误,不存在CtlNodes节点"; return(false); } try { IEnumerable <XElement> nodeXEList = from el in CtlnodeRoot.Elements() where el.Name == "Node" select el; foreach (XElement el in nodeXEList) { string className = (string)el.Attribute("className"); CtlNodeBaseModel ctlNode = null; switch (className) { case "NbProcessCtl.NodePalletBind": { ctlNode = new NodePalletBind(); break; } case "NbProcessCtl.NodePalletUnBind": { ctlNode = new NodePalletUnBind(); break; } case "NbProcessCtl.NodeManualBind": { ctlNode = new NodeManualBind(); break; } case "NbProcessCtl.NodeManualPacket": { ctlNode = new NodeManualPacket(); break; } case "NbProcessCtl.NodeOcv": { ctlNode = new NodeOcv(); break; } case "NbProcessCtl.NodeGrasp": { ctlNode = new NodeGrasp(); break; } case "NbProcessCtl.NodeVirStation": { ctlNode = new NodeVirStation(); break; } //case "NbProcessCtl.NodeSwitch": // { // ctlNode = new NodeSwitch(); // break; // } default: break; } if (ctlNode != null) { if (!ctlNode.BuildCfg(el, ref reStr)) { return(false); } else if (className == "NbProcessCtl.NodeGrasp") { NodeGrasp graspNode = ctlNode as NodeGrasp; graspNode.OcvAccess = ocvAccess; } ctlNode.PlcRW = GetPlcByID(ctlNode.PlcID); // this.plcRWs[2]; if (ctlNode.RfidID > 0) { ctlNode.RfidRW = GetRfidByID(ctlNode.RfidID); } if (!SysCfg.SysCfgModel.SimMode) { //ctlNode.RfidRW = GetRfidByID((byte)ctlNode.RfidID); if (ctlNode.BarcodeID > 0) { ctlNode.BarcodeRW = GetBarcoderRWByID(ctlNode.BarcodeID); } } //Console.WriteLine(ctlNode.NodeName + ",ID:" + ctlNode.NodeID + "创建成功!"); this.monitorNodeList.Add(ctlNode); } } } catch (Exception ex) { reStr = ex.ToString(); return(false); } return(true); }